#include "centraldisplaydialog.h"
#include "ui_centraldisplaydialog.h"
#include <qqtframe.h>

CentralDisplayDialog::CentralDisplayDialog ( QWidget* parent ) :
    QQtClickDialog ( parent ),
    ui ( new Ui::CentralDisplayDialog )
{
    ui->setupUi ( this );

    ui->widget->setIcon ( skin ( "demo/icon_default.png" ) );
    ui->widget->setText ( "SECURITY" );

    ui->widget_2->setIcon ( skin ( "demo/icon_default.png" ) );
    ui->widget_2->setText ( "WARNING!" );

    setWindowFlags ( Qt::FramelessWindowHint );

    setPixmap ( skin ( "demo/bk_main.png" ) );
}

CentralDisplayDialog::~CentralDisplayDialog()
{
    delete ui;
}

void CentralDisplayDialog::setLightNo ( const QList<int>& lightNoList )
{
    if ( lightNoList.size() <= 0 )
        return;

    QString lightNoString;

    QListIterator<int> itor ( lightNoList );

    int firstNo = itor.next();
    lightNoString.append ( QString::number ( firstNo ) );

    while ( itor.hasNext() )
    {
        int lightNo = itor.next();
        lightNoString.append ( "." ).append ( QString::number ( lightNo ) );
    }

    ui->label->setText ( QString ( "LIGHT NO. " ).append ( lightNoString ) );
}
